function [ otf ] = OTF(r0,n,twosides)

if nargin==2
    twosides = false;
end

if twosides
    x = -2:(4/(n-1)):2;
else
    x = 0:(2/(n-1)):2;
end
otf = zeros(1,n);
idx = abs(x)<=(2*r0);

x = abs(x);
dum =  2/pi*(acos(x/(2*r0)) - (x/(2*r0)).*sqrt(1-(x/(2*r0)).^2));
otf(idx) = dum(idx);

end

